import request from '@/utils/request'
export default{
  // 1.查询指定章
  getById(id) {
    return request({
      url: `/admin/edu/chapter/getById/${id}`,
      method: 'get'
    })
  },
  // 2.更新章
  updateChapter(chapter) {
    return request({
      url: 'admin/edu/chapter/update',
      method: 'put',
      data: chapter
    })
  },
  // 3.新增章
  saveChapter(chapter) {
    return request({
      url: '/admin/edu/chapter/save',
      method: 'post',
      data: chapter
    })
  },
  // 4.删除指定章
  deleteById(id) {
    return request({
      url: `/admin/edu/chapter/remove/${id}`,
      method: 'delete'
    })
  },
  // 5.获取章的嵌套查询
  getChaptersByCourseId(courseId) {
    return request({
      url: `/admin/edu/chapter/getChapters/${courseId}`,
      method: 'get'
    })
  }
}
